package erp_services

import (
	"errors"
	"xiehui-service/app/models/erp_models"
	"xiehui-service/global"
)

type tphbMaterialOrderService struct {
}

var TphbMaterialOrderService = new(tphbMaterialOrderService)

// 根据ID查询数据
func (tphbMaterialOrderService *tphbMaterialOrderService) GetByPhbMaterialOrderId(tphb_order_id uint) (phbMaterialOrders []erp_models.TphbMaterialOrder, err error) {
	if err = global.App.DB.Where("tphb_order_id = ?", tphb_order_id).Find(&phbMaterialOrders).Error; err != nil {
		err = errors.New("未查询到配比下达关联信息")
		return nil, err
	}

	return phbMaterialOrders, nil
}
